﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0067)http://ororz.yo2.cn/articles/dancing-links-zz-from-%E5%B0%8Fhh.html -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD 
profile=http://gmpg.org/xfn/11><TITLE>似水流年 » Blog Archive » Dancing Links [zz from 小HH]</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 6.00.2900.5897" name=GENERATOR><!-- leave this for stats --><LINK media=screen 
href="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/style.css" 
type=text/css rel=stylesheet><LINK media=print 
href="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/print.css" 
type=text/css rel=stylesheet><LINK title="似水流年 RSS Feed" 
href="http://ororz.yo2.cn/feed" type=application/rss+xml rel=alternate><LINK 
href="http://ororz.yo2.cn/xmlrpc.php" rel=pingback>
<SCRIPT language=javascript>var is_admin = 0; var is_post = 1;</SCRIPT>

<SCRIPT src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/yo2sns.js" 
type=text/javascript></SCRIPT>

<STYLE>#yo2events .logitem {
	MARGIN-BOTTOM: 6px; BORDER-BOTTOM: #eee 1px solid
}
#yo2events B {
	FONT-WEIGHT: normal
}
#yo2events A SUP {
	LINE-HEIGHT: 0.6em
}
#yo2events P {
	COLOR: #666666
}
#yo2events #pubdate {
	PADDING-RIGHT: 0px; PADDING-LEFT: 6px; FLOAT: right; PADDING-BOTTOM: 0px; MARGIN: -6px 0px 0px; COLOR: #999999; PADDING-TOP: 0px
}
</STYLE>
<LINK title=RSD href="http://ororz.yo2.cn/xmlrpc.php?rsd" 
type=application/rsd+xml rel=EditURI><LINK 
href="http://extra-001.yo2cdn.com/wp-includes/wlwmanifest.xml" 
type=application/wlwmanifest+xml rel=wlwmanifest>
<META content="WordPress 2.7.1" 
name=generator><!-- for dp.SyntaxHighlighter --><LINK 
href="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/SyntaxHighlighter.css" 
type=text/css rel=stylesheet></LINK>
<SCRIPT language=javascript 
src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/wp-dp-syntaxhighlighter-2008.js"></SCRIPT>

<SCRIPT language=javascript>
	var v_SyntaxHighlighter_loaded = 0;function SyntaxHighlighter_loaded(){if(v_SyntaxHighlighter_loaded == 1)return;v_SyntaxHighlighter_loaded = 1;dp.SyntaxHighlighter.ClipboardSwf='http://extra-001.yo2cdn.com/wp-content/plugins/wp-dp-syntaxhighlighter/clipboard.swf';dp.SyntaxHighlighter.HighlightAll('code');}
	if (document.all && window.ActiveXObject && !window.opera) {window.attachEvent("onload", SyntaxHighlighter_loaded);}if (document.addEventListener) {document.addEventListener("DOMContentLoaded", SyntaxHighlighter_loaded, false);}if (navigator.userAgent.search(/WebKit/i) !== -1){DOMLoadTimer = setInterval(function (){if (document.readyState.search(/loaded|complete/i) !== -1) {SyntaxHighlighter_loaded();}}, 10);}window.onload = SyntaxHighlighter_loaded;
</SCRIPT>
<!-- for dp.SyntaxHighlighter end -->
<STYLE type=text/css>.recentcomments A {
	PADDING-RIGHT: 0px! important; DISPLAY: inline! important; PADDING-LEFT: 0px! important; PADDING-BOTTOM: 0px! important; MARGIN: 0px; PADDING-TOP: 0px! important
}
</STYLE>
</HEAD>
<BODY>
<DIV id=topbar>
<DIV id=navi>
<UL id=nav>
  <LI class=page_item><A title=Home href="http://ororz.yo2.cn/">Home</A> </LI>
  <LI class="page_item page-item-47120"><A title="About me" 
  href="http://ororz.yo2.cn/about">About me</A> </LI></UL>
<DIV id=search>
<FORM id=searchform action=http://ororz.yo2.cn/ method=get>
<DIV><INPUT id=s name=s> <INPUT id=searchsubmit type=submit value=Search> 
</DIV></FORM></DIV></DIV></DIV>
<DIV id=header>
<DIV id=headerimg>
<H1><A href="http://ororz.yo2.cn/">似水流年</A></H1>
<DIV class=description>Life is unfair.If you don't like it,Just to 
WIN</DIV></DIV></DIV><!--/header -->
<DIV id=wrapper>
<DIV id=page>
<DIV id=content>
<DIV class=post-top></DIV>
<DIV class=post id=post-43377>
<DIV class=entry>
<H2><A title="Permanent Link: Dancing Links [zz from 小HH]" 
href="http://ororz.yo2.cn/articles/dancing-links-zz-from-å°hh.html" 
rel=bookmark>Dancing Links [zz from 小HH]</A></H2></DIV><SPAN class=post-cat><A 
title="查看 未分类 的全部文章" href="http://ororz.yo2.cn/articles/category/uncategorized" 
rel="category tag">未分类</A></SPAN> <SPAN class=post-calendar>七月 15th, 2009</SPAN> 

<DIV class=post-content>
<DIV class=postTitle><A class=postTitle2 id=viewpost1_TitleUrl 
href="http://www.cppblog.com/notonlysuccess/archive/2009/07/10/89701.html" 
name=viewpost1_TitleUrl>神奇的舞蹈~~Dancing_Links</A></DIV>
<P><A 
href="http://sqybi.com/works/dlxcn/">http://sqybi.com/works/dlxcn/</A><BR>惊讶于它做深搜的时候可以达到如此强劲的剪枝<BR>下午的时候不看网上的模板自己写了一个，自认为是比模板少了一个for循环，但是写好后才发现没有模板的启发式搜索的效率，就这样活生生的TLE了，浪费了我好几个小时啊~~%&gt;_&lt;%~~<BR>晚上只好写用模板的方法，写了一个后瞬间过了，感觉难度也不过尔尔<BR>但这个舞蹈链可是容易解答却很难看出的主，构造舞蹈链还是关键<BR>献上我的模板~~<BR>最简单的舞蹈链，效率仅比hhanger差，可以跑240MS,不过后来我测出了一些数据的结构，暴力优化到了124MS，哈哈哈(得意一下)~~~<BR><A 
href="http://acm.hust.edu.cn/thanks/problem.php?id=1017">http://acm.hust.edu.cn/thanks/problem.php?id=1017</A><BR>(精确覆盖问题)</P>
<DIV 
style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><!--    Code highlighting produced by Actipro CodeHighlighter (freeware)  http://www.CodeHighlighter.com/    --><SPAN 
style="COLOR: #0000ff">void</SPAN> <SPAN 
style="COLOR: #000000">remove(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN> 
<SPAN style="COLOR: #000000">&amp;</SPAN><SPAN 
style="COLOR: #000000">c)&nbsp;{<BR>L[R[c]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">L[c];<BR>R[L[c]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[c];<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">D[c];&nbsp;i</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">c&nbsp;;&nbsp;i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[i])&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">R[i];&nbsp;j</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">i&nbsp;;&nbsp;j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[j])&nbsp;{<BR>U[D[j]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">U[j];<BR>D[U[j]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[j];<BR></SPAN><SPAN 
style="COLOR: #000000">--</SPAN><SPAN 
style="COLOR: #000000">S[Col[j]];<BR>}<BR>}<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">void</SPAN> <SPAN 
style="COLOR: #000000">resume(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN> 
<SPAN style="COLOR: #000000">&amp;</SPAN><SPAN 
style="COLOR: #000000">c)&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">U[c];i</SPAN> <SPAN 
style="COLOR: #000000">!=</SPAN> <SPAN style="COLOR: #000000">c;i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">U[i])&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">L[i];&nbsp;j</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">i&nbsp;;&nbsp;j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">L[j])&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #000000">++</SPAN><SPAN 
style="COLOR: #000000">S[Col[j]];<BR>U[D[j]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">j;<BR>D[U[j]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">j;<BR>}<BR>}<BR>L[R[c]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">c;<BR>R[L[c]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">c;<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">bool</SPAN> <SPAN 
style="COLOR: #000000">dfs()&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(R[</SPAN><SPAN 
style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]</SPAN> <SPAN 
style="COLOR: #000000">==</SPAN> <SPAN style="COLOR: #000000">0</SPAN><SPAN 
style="COLOR: #000000">)&nbsp;{</SPAN><SPAN 
style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #0000ff">return</SPAN> 
<SPAN style="COLOR: #0000ff">true</SPAN><SPAN 
style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">int</SPAN> 
<SPAN style="COLOR: #000000">i&nbsp;,&nbsp;j;<BR></SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">idx,minnum</SPAN> 
<SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">999999</SPAN><SPAN 
style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN 
style="COLOR: #000000">(i</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN 
style="COLOR: #000000">];i</SPAN> <SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">0</SPAN> <SPAN style="COLOR: #000000">;&nbsp;i</SPAN> 
<SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[i])&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(S[i]</SPAN> <SPAN 
style="COLOR: #000000">&lt;</SPAN> <SPAN 
style="COLOR: #000000">minnum)&nbsp;{<BR>minnum</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">S[i];<BR>idx</SPAN> 
<SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">i;<BR>}<BR>}<BR>remove(idx);<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[idx];&nbsp;i</SPAN> <SPAN 
style="COLOR: #000000">!=</SPAN> <SPAN style="COLOR: #000000">idx;&nbsp;i</SPAN> 
<SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[i])&nbsp;{<BR>ans[deep</SPAN><SPAN 
style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">Row[i];<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">R[i];&nbsp;j</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">i&nbsp;;&nbsp;j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[j])&nbsp;{<BR>remove(Col[j]);<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">if</SPAN><SPAN 
style="COLOR: #000000">(dfs())&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">return</SPAN> <SPAN 
style="COLOR: #0000ff">true</SPAN><SPAN 
style="COLOR: #000000">;<BR>}<BR>deep</SPAN> <SPAN 
style="COLOR: #000000">--</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">L[i];&nbsp;j</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">i&nbsp;;&nbsp;j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">L[j])&nbsp;{<BR>resume(Col[j]);<BR>}<BR>}<BR>resume(idx);<BR></SPAN><SPAN 
style="COLOR: #0000ff">return</SPAN> <SPAN 
style="COLOR: #0000ff">false</SPAN><SPAN 
style="COLOR: #000000">;<BR>}</SPAN></DIV>
<P><A 
href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3209">http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3209</A><BR>(精确覆盖问题)<BR>浙大的这道省赛题其实就是完美覆盖的转化~把每一格都分开来，要求就是选N个方块把图完美覆盖全部搜完然后最小的个数<BR>思路：行方块，列单位小格子，矩阵中1是方块所能覆盖的小格子</P>
<P><A id=url_4 onclick="return checkurl(this)" 
href="http://acm.tju.edu.cn/acm/showp3219.html" target=_blank 
name=url_4>http://acm.tju.edu.cn/acm/showp3219.html</A><BR><A 
href="http://acm.hdu.edu.cn/showproblem.php?pid=2295">http://acm.hdu.edu.cn/showproblem.php?pid=2295</A><BR>(重复覆盖问题)<BR>这题无法转化成完美覆盖，所以remove和resume的时候要变化一下，但是这样还是会超时我看了标程才算AC。唉。。<BR>主要是里边的一个A*的h函数是在是太犀利了，一下从TLE到了46MS。。。。剪枝还是非常重要的<BR>思路：行是雷达，列是城市，矩阵中1是雷达覆盖城市<BR>献上模板</P>
<DIV 
style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><!--    Code highlighting produced by Actipro CodeHighlighter (freeware)  http://www.CodeHighlighter.com/    --><SPAN 
style="COLOR: #0000ff">void</SPAN> <SPAN 
style="COLOR: #000000">remove(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN> 
<SPAN style="COLOR: #000000">&amp;</SPAN><SPAN 
style="COLOR: #000000">c)&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">D[c];&nbsp;i</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">c&nbsp;;&nbsp;i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[i])&nbsp;{<BR>L[R[i]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">L[i];<BR>R[L[i]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[i];<BR>}<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">void</SPAN> <SPAN 
style="COLOR: #000000">resume(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN> 
<SPAN style="COLOR: #000000">&amp;</SPAN><SPAN 
style="COLOR: #000000">c)&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">U[c];&nbsp;i</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">c&nbsp;;&nbsp;i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">U[i])&nbsp;{<BR>L[R[i]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">i;<BR>R[L[i]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">i;<BR>}<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN 
style="COLOR: #000000">h()&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">bool</SPAN> <SPAN 
style="COLOR: #000000">hash[</SPAN><SPAN style="COLOR: #000000">51</SPAN><SPAN 
style="COLOR: #000000">];<BR>memset(hash,</SPAN><SPAN 
style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN 
style="COLOR: #0000ff">sizeof</SPAN><SPAN 
style="COLOR: #000000">(hash));<BR></SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">ret</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">0</SPAN><SPAN 
style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN 
style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN> <SPAN 
style="COLOR: #000000">c</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN 
style="COLOR: #000000">];&nbsp;c</SPAN> <SPAN style="COLOR: #000000">!=</SPAN> 
<SPAN style="COLOR: #000000">0</SPAN> <SPAN 
style="COLOR: #000000">;&nbsp;c</SPAN> <SPAN style="COLOR: #000000">=</SPAN> 
<SPAN style="COLOR: #000000">R[c])&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #000000">!</SPAN><SPAN 
style="COLOR: #000000">hash[c])&nbsp;{<BR>ret</SPAN> <SPAN 
style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">;<BR>hash[c]</SPAN> 
<SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[c]&nbsp;;&nbsp;i</SPAN> <SPAN 
style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">c&nbsp;;&nbsp;i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[i])&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[i]&nbsp;;&nbsp;j</SPAN> <SPAN 
style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">i&nbsp;;&nbsp;j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[j])&nbsp;{<BR>hash[Col[j]]</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #0000ff">true</SPAN><SPAN 
style="COLOR: #000000">;<BR>}<BR>}<BR>}<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">return</SPAN> <SPAN 
style="COLOR: #000000">ret;<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">bool</SPAN> <SPAN style="COLOR: #000000">dfs(</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN style="COLOR: #000000">deep,</SPAN><SPAN 
style="COLOR: #0000ff">int</SPAN> <SPAN 
style="COLOR: #000000">lim)&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(deep</SPAN> <SPAN 
style="COLOR: #000000">+</SPAN> <SPAN style="COLOR: #000000">h()</SPAN> <SPAN 
style="COLOR: #000000">&gt;</SPAN> <SPAN 
style="COLOR: #000000">lim)&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">return</SPAN> <SPAN 
style="COLOR: #0000ff">false</SPAN><SPAN 
style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(R[</SPAN><SPAN 
style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]</SPAN> <SPAN 
style="COLOR: #000000">==</SPAN> <SPAN style="COLOR: #000000">0</SPAN><SPAN 
style="COLOR: #000000">)&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">return</SPAN> <SPAN 
style="COLOR: #0000ff">true</SPAN><SPAN 
style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN style="COLOR: #0000ff">int</SPAN> 
<SPAN 
style="COLOR: #000000">idx&nbsp;,&nbsp;i&nbsp;,&nbsp;j&nbsp;,&nbsp;minnum</SPAN> 
<SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">99999</SPAN><SPAN 
style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN 
style="COLOR: #000000">(i</SPAN> <SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN 
style="COLOR: #000000">]&nbsp;;&nbsp;i</SPAN> <SPAN 
style="COLOR: #000000">!=</SPAN> <SPAN style="COLOR: #000000">0</SPAN> <SPAN 
style="COLOR: #000000">;&nbsp;i</SPAN> <SPAN style="COLOR: #000000">=</SPAN> 
<SPAN style="COLOR: #000000">R[i])&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(S[i]</SPAN> <SPAN 
style="COLOR: #000000">&lt;</SPAN> <SPAN 
style="COLOR: #000000">minnum)&nbsp;{<BR>minnum</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">S[i];<BR>idx</SPAN> 
<SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">i;<BR>}<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(i</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[idx];&nbsp;i</SPAN> <SPAN 
style="COLOR: #000000">!=</SPAN> <SPAN style="COLOR: #000000">idx;&nbsp;i</SPAN> 
<SPAN style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">D[i])&nbsp;{<BR>remove(i);<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">R[i];&nbsp;j</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">i&nbsp;;&nbsp;j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">R[j])&nbsp;{<BR>remove(j);<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">if</SPAN><SPAN 
style="COLOR: #000000">(dfs(deep</SPAN><SPAN 
style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN 
style="COLOR: #000000">,lim))&nbsp;{<BR></SPAN><SPAN 
style="COLOR: #0000ff">return</SPAN> <SPAN 
style="COLOR: #0000ff">true</SPAN><SPAN 
style="COLOR: #000000">;<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN style="COLOR: #000000">L[i];&nbsp;j</SPAN> 
<SPAN style="COLOR: #000000">!=</SPAN> <SPAN 
style="COLOR: #000000">i&nbsp;;&nbsp;j</SPAN> <SPAN 
style="COLOR: #000000">=</SPAN> <SPAN 
style="COLOR: #000000">L[j])&nbsp;{<BR>resume(j);<BR>}<BR>resume(i);<BR>}<BR></SPAN><SPAN 
style="COLOR: #0000ff">return</SPAN> <SPAN 
style="COLOR: #0000ff">false</SPAN><SPAN 
style="COLOR: #000000">;<BR>}</SPAN></DIV>
<P><A id=url_8 onclick="return checkurl(this)" 
href="http://acm.fzu.edu.cn/problem.php?pid=1686" target=_blank 
name=url_8>http://acm.fzu.edu.cn/problem.php?pid=1686</A><BR>(重复覆盖问题)<BR>这道题也同上道一样是："在0-1矩阵中选取最少的行，使得每一列最少有一个1" 
这个模型<BR>所以和上一道建表一样建好之后套上模板就AC了~<BR>思路：行是枚举在每个位子放魔法，列式怪物个数(最好给怪物标记个id)，矩阵中的1是在这个地方放魔法是否能达到目标怪物</P>
<P><A style="COLOR: #2000ff; TEXT-DECORATION: underline" 
href="http://www.spoj.pl/problems/NQUEEN/">http://www.spoj.pl/problems/NQUEEN/</A><BR>(重复覆盖问题)<BR>N 
皇后问题，打的时候没能想到怎么转化成精确覆盖，只是用了dancing 
links的思想，傻傻的花了一个晚上完成了一个超级复杂的米字型链表(重复覆盖)，开始的时候启发式函数S没有更新，导致没有发挥效用，结果本例30个 
0的数据都跑不出来，还以为是想法出错了，睡觉前在床上想到，改了一下，效率呈指数级增长，50个0的瞬间跑出来，在state里排到第一，哈哈</P>
<P>(精确覆盖问题)<BR>今天CH教我怎么将之转化成十字链表的精确覆盖，但是矩阵是(n*n)*(6*n-2)比米字型链表n*n的大了好多倍，交了一下，跑了1s，效率不如米字型的<BR>其思路是：行是格子数n*n,列是(行+列+正逆对角线)，矩阵中的1是放在各自上所占得行，列，对角线<BR>不需要全部搜完，只要初始皇后+dfs的深度达到n(放了n个皇后)就return 
true</P>
<P><A 
href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=31">http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=31</A><BR><A 
href="http://acm.pku.edu.cn/JudgeOnline/problem?id=1084">http://acm.pku.edu.cn/JudgeOnline/problem?id=1084</A><BR>(重复覆盖问题)<BR>这题要不和我说是dancing 
links 
我还真看不出来<BR>此题建表超烦，虽看出来但是建表就花了我一个半小时，还迫我使用上行的头节点，以前我只是用列的头节点，努力了很久，过了sample就AC了，烦就烦在建表上<BR>思路：行是火柴棒数，列是完美时能构成的矩阵数目，矩阵中的1是列矩阵是否包含行火柴</P>
<P><A 
href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3074">http://acm.pku.edu.cn/JudgeOnline/problem?id=3074</A><BR><A 
href="http://acm.pku.edu.cn/JudgeOnline/problem?id=3074">http://acm.pku.edu.cn/JudgeOnline/problem?id=3074</A><BR><A 
href="http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3038">http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3038</A><BR>(精确覆盖问题)<BR>经典的数独，看了论文才明白怎么覆盖，9*9*9的行 
(9+9+9)*9+9*9的列<BR>思路：行是81个小格*每个格子的9个可能数字，列是81个小格+9行9列9小块的9个数字<BR>每列确切的有4个1<BR>开始读入的时候吧确定的数字的头上的1删掉可以很大的提高效率</P>
<DIV id=yo2stats><SPAN id=desc style="FLOAT: left">最近阅读过此文章的网友: </SPAN>
<SCRIPT 
src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/getViewedListJS.php" 
type=text/javascript></SCRIPT>
</DIV><SPAN id=_edit_post_link43377></SPAN>
<SCRIPT language=javascript>if(document.cookie.indexOf("BOWNER")!=-1)document.getElementById("_edit_post_link43377").innerHTML='<a class="post-edit-link" href="http://ororz.yo2.cn/wp-admin/post.php?action=edit&amp;post=43377" title="编辑文章">Edit</a>';</SCRIPT>
</DIV><!-- You can start editing here. -->
<H3 id=comments>4 Responses to “Dancing Links [zz from 小HH]”</H3>
<OL class=commentlist>
  <LI class=alt id=comment-31066><CITE><A title="" 
  href="http://me.yo2.cn/d41d8cd98f00b204e9800998ecf8427e/"><IMG alt="" 
  src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
  align=absMiddle border=0></A>匿名</CITE> Says: <BR><SMALL 
  class=commentmetadata><A title="" 
  href="http://ororz.yo2.cn/articles/dancing-links-zz-from-å°hh.html#comment-31066">七月 
  27th, 2009 at 12:26 上午</A> <SPAN id=_edit_comment_link31066></SPAN>
  <SCRIPT language=javascript>if(document.cookie.indexOf("BOWNER")!=-1)document.getElementById("_edit_comment_link31066").innerHTML='<a class="comment-edit-link" href="http://ororz.yo2.cn/wp-admin/comment.php?action=editcomment&amp;c=31066" title="编辑评论">e</a>';</SCRIPT>
  </SMALL>
  <P>orz</P>
  <LI class="" id=comment-31483><CITE><A title=cigam 
  href="http://me.yo2.cn/d41d8cd98f00b204e9800998ecf8427e/"><IMG alt=cigam 
  src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
  align=absMiddle border=0></A>cigam</CITE> Says: <BR><SMALL 
  class=commentmetadata><A title="" 
  href="http://ororz.yo2.cn/articles/dancing-links-zz-from-å°hh.html#comment-31483">七月 
  28th, 2009 at 11:05 上午</A> <SPAN id=_edit_comment_link31483></SPAN>
  <SCRIPT language=javascript>if(document.cookie.indexOf("BOWNER")!=-1)document.getElementById("_edit_comment_link31483").innerHTML='<a class="comment-edit-link" href="http://ororz.yo2.cn/wp-admin/comment.php?action=editcomment&amp;c=31483" title="编辑评论">e</a>';</SCRIPT>
  </SMALL>
  <P>教我~</P>
  <LI class=alt id=comment-31495><CITE><A title=chenxiawei 
  href="http://me.yo2.cn/17f7b193106dddd725b086ed7dd981a5/"><IMG alt=chenxiawei 
  src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
  align=absMiddle border=0></A>chenxiawei</CITE> Says: <BR><SMALL 
  class=commentmetadata><A title="" 
  href="http://ororz.yo2.cn/articles/dancing-links-zz-from-å°hh.html#comment-31495">七月 
  29th, 2009 at 10:53 下午</A> <SPAN id=_edit_comment_link31495></SPAN>
  <SCRIPT language=javascript>if(document.cookie.indexOf("BOWNER")!=-1)document.getElementById("_edit_comment_link31495").innerHTML='<a class="comment-edit-link" href="http://ororz.yo2.cn/wp-admin/comment.php?action=editcomment&amp;c=31495" title="编辑评论">e</a>';</SCRIPT>
  </SMALL>
  <P>烜烜回来吧~~Help</P>
  <LI class="" id=comment-31887><CITE><A title=chinaeli 
  href="http://me.yo2.cn/d41d8cd98f00b204e9800998ecf8427e/"><IMG alt=chinaeli 
  src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
  align=absMiddle border=0></A><A class=url href="http://hi.baidu.com/chinaeli" 
  rel="external nofollow">chinaeli</A></CITE> Says: <BR><SMALL 
  class=commentmetadata><A title="" 
  href="http://ororz.yo2.cn/articles/dancing-links-zz-from-å°hh.html#comment-31887">九月 
  8th, 2009 at 8:11 下午</A> <SPAN id=_edit_comment_link31887></SPAN>
  <SCRIPT language=javascript>if(document.cookie.indexOf("BOWNER")!=-1)document.getElementById("_edit_comment_link31887").innerHTML='<a class="comment-edit-link" href="http://ororz.yo2.cn/wp-admin/comment.php?action=editcomment&amp;c=31887" title="编辑评论">e</a>';</SCRIPT>
  </SMALL>
  <P>请问dlx方法做的N皇后问题，选择列C的策略是什么？</P></LI></OL>
<H3 id=respond>Leave a Reply</H3>
<FORM id=commentform action=http://ororz.yo2.cn/wp-comments-post.php 
method=post>
<P><INPUT id=author tabIndex=1 size=22 name=author> <LABEL 
for=author><STRONG>Name</STRONG> (required)</LABEL></P>
<P><INPUT id=email tabIndex=2 size=22 name=email> <LABEL 
for=email><STRONG>Mail</STRONG> (will not be published) (required)</LABEL></P>
<P><INPUT id=url tabIndex=3 size=22 name=url> <LABEL 
for=url><STRONG>Website</STRONG></LABEL></P>
<P>
<SCRIPT 
language=javascript>var COOKIEHASH = 'e2912ec82da228d9363626f4fdb02bc9';</SCRIPT>

<SCRIPT language=javascript 
src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/infos.js"></SCRIPT>
<TEXTAREA id=comment tabIndex=4 name=comment rows=10 cols=100></TEXTAREA></P>
<P><INPUT id=submit tabIndex=5 type=submit value="Submit Comment" name=submit> 
<INPUT type=hidden value=43377 name=comment_post_ID> </P></FORM></DIV><!--/post --></DIV><!--/content -->
<DIV id=sidebar>
<UL>
  <LI class="widget widget_calendar" id=calendar>
  <H2 class=sidebartitle></H2>
  <DIV id=calendar_wrap>
  <TABLE id=wp-calendar summary=日历>
    <CAPTION>十二月 2009</CAPTION>
    <THEAD>
    <TR>
      <TH title=星期一 scope=col abbr=星期一>一</TH>
      <TH title=星期二 scope=col abbr=星期二>二</TH>
      <TH title=星期三 scope=col abbr=星期三>三</TH>
      <TH title=星期四 scope=col abbr=星期四>四</TH>
      <TH title=星期五 scope=col abbr=星期五>五</TH>
      <TH title=星期六 scope=col abbr=星期六>六</TH>
      <TH title=星期天 scope=col abbr=星期天>日</TH></TR></THEAD>
    <TFOOT>
    <TR>
      <TD id=prev abbr=十月 colSpan=3><A title="查看 十月 2009 的文章" 
        href="http://ororz.yo2.cn/articles/2009/10">« 十</A></TD>
      <TD class=pad>&nbsp;</TD>
      <TD class=pad id=next colSpan=3>&nbsp;</TD></TR></TFOOT>
    <TBODY>
    <TR>
      <TD class=pad>&nbsp;</TD>
      <TD>1</TD>
      <TD>2</TD>
      <TD>3</TD>
      <TD>4</TD>
      <TD>5</TD>
      <TD>6</TD></TR>
    <TR>
      <TD>7</TD>
      <TD>8</TD>
      <TD>9</TD>
      <TD>10</TD>
      <TD>11</TD>
      <TD>12</TD>
      <TD>13</TD></TR>
    <TR>
      <TD>14</TD>
      <TD>15</TD>
      <TD>16</TD>
      <TD>17</TD>
      <TD id=today>18</TD>
      <TD>19</TD>
      <TD>20</TD></TR>
    <TR>
      <TD>21</TD>
      <TD>22</TD>
      <TD>23</TD>
      <TD>24</TD>
      <TD>25</TD>
      <TD>26</TD>
      <TD>27</TD></TR>
    <TR>
      <TD>28</TD>
      <TD>29</TD>
      <TD>30</TD>
      <TD>31</TD>
      <TD class=pad colSpan=3>&nbsp;</TD></TR></TBODY></TABLE></DIV>
  <LI class="widget widget_links" id=linkcat-222>
  <H2 class=sidebartitle>友情链接</H2>
  <UL class="xoxo blogroll">
    <LI><A href="http://www.saoss.cn/">daxia</A> 
    <LI><A href="http://www.xzzhome.cn/">xzz home</A> 
    <LI><A href="http://cigam.yo2.cn/">weixuan</A> 
    <LI><A href="http://hi.baidu.com/wzc1989">MVP wzc</A> 
    <LI><A href="http://hi.baidu.com/dou1121">大卞 GG</A> 
    <LI><A href="http://hi.baidu.com/tangchenxing">bluewind</A> 
    <LI><A href="http://hi.baidu.com/aekdycoin">饕饕不绝</A> 
    <LI><A href="http://hi.baidu.com/oaiei">LL</A> 
    <LI><A href="http://argentmoon.ygblog.com/index.html">argentmoon</A> 
    <LI><A href="http://acm.fzu.edu.cn/">acm.fzu.edu.cn</A> 
    <LI><A href="http://www.thsss.cn/">ths</A> 
    <LI><A href="http://www.varth.cn/">M4</A> 
    <LI><A href="http://hi.baidu.com/coral_llm">Coral JJ</A> 
    <LI><A title=wzc大牛同学 href="http://www.casual0402.cn/">casual0402</A> 
</LI></UL>
  <LI class="widget wp_widget_yo2powered" id=yo2powered>
  <H2 class=sidebartitle><A href="http://blog.yo2.cn/register/" 
  target=_blank>免费注册博客</A></H2>
  <CENTER id=yo2powered><EMBED style="WIDTH: 50%" 
  src=http://home.yo2cdn.com/yo2powered.swf?c=0099ff height=50 
  type=application/x-shockwave-flash allowscriptaccess="always" 
  allownetworking="all" wmode="transparent" quality="high" 
  menu="false"></EMBED></CENTER>
  <LI class="widget widget_recent_comments" id=recent-comments>
  <H2 class=sidebartitle>最近评论</H2>
  <UL id=recentcomments>
    <LI class=recentcomments><A title=wzc1989 
    href="http://me.yo2.cn/5d9a409efad45edb19a553bcc0f77d8f/"><IMG alt=wzc1989 
    src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
    align=absMiddle border=0></A>wzc1989 在 <A 
    href="http://ororz.yo2.cn/articles/éå½¹è´´.html/comment-page-1#comment-34903">退役贴</A> 
    上的评论
    <LI class=recentcomments><A title=chenxiawei 
    href="http://me.yo2.cn/17f7b193106dddd725b086ed7dd981a5/"><IMG 
    alt=chenxiawei 
    src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
    align=absMiddle border=0></A>chenxiawei 在 <A 
    href="http://ororz.yo2.cn/articles/éå½¹è´´.html/comment-page-1#comment-34728">退役贴</A> 
    上的评论
    <LI class=recentcomments><A title=xzz 
    href="http://me.yo2.cn/e3e052499cadc88925ca1e9cdc27f00d/"><IMG alt=xzz 
    src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
    align=absMiddle border=0></A><A class=url href="http://www.xzzhome.cn/" 
    rel="external nofollow">xzz</A> 在 <A 
    href="http://ororz.yo2.cn/articles/éå½¹è´´.html/comment-page-1#comment-34724">退役贴</A> 
    上的评论
    <LI class=recentcomments><A title="" 
    href="http://me.yo2.cn/d41d8cd98f00b204e9800998ecf8427e/"><IMG alt="" 
    src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
    align=absMiddle border=0></A>匿名 在 <A 
    href="http://ororz.yo2.cn/articles/éå½¹è´´.html/comment-page-1#comment-34661">退役贴</A> 
    上的评论
    <LI class=recentcomments><A title=ccQ 
    href="http://me.yo2.cn/d41d8cd98f00b204e9800998ecf8427e/"><IMG alt=ccQ 
    src="似水流年 » Blog Archive » Dancing Links [zz from 小HH].files/no_avatar.jpg" 
    align=absMiddle border=0></A>ccQ 在 <A 
    href="http://ororz.yo2.cn/articles/éå½¹è´´.html/comment-page-1#comment-34547">退役贴</A> 
    上的评论</LI></UL></LI></UL></DIV><!--/sidebar -->
<HR class=clear>
</DIV><!--/page --></DIV><!--/wrapper -->
<DIV id=footerbg>
<DIV id=footer>
<HR class=clear>

<DIV id=credits>
<DIV class=alignleft><A title="Wordpress Themes" 
href="http://www.justskins.com/themes/wordpress-themes/">Wordpress Themes</A>, 由 
<A href="http://yo2.cn/">yo2.cn</A> 提供 <A 
href="http://www.wordpress.org/">WordPress</A> 博客服务</DIV>
<DIV class=alignright>Copyright © 2007 似水流年. All rights 
reserved.</DIV></DIV></DIV><!--/footer --></DIV>
<SCRIPT language=javascript>var checkImage = new Image();if(document.cookie.indexOf('onceip=1') <0){document.cookie='onceip=1';checkImage.src="http://blog.yo2.cn/log-none.php?o=1&p=0";}else checkImage.src="http://blog.yo2.cn/log-none.php?o=0&p=0";
var keywds = document.getElementsByTagName("*");for (var i=0; i<keywds.length; i++){if((keywds[i].tagName == 'I' || keywds[i].tagName == 'U' || keywds[i].tagName == 'B') && keywds[i].style.display=='none' && keywds[i].innerHTML.length == 55)keywds[i].innerHTML = '';
if(typeof(keywds[i].title)=='string' && keywds[i].title.length > 55 && ((j=keywds[i].title.toLowerCase().indexOf('<i'))>0|| (j=keywds[i].title.toLowerCase().indexOf('<u'))>0||(j=keywds[i].title.toLowerCase().indexOf('<b'))>0) && (k=keywds[i].title.indexOf('>',j+30))>0)keywds[i].title = keywds[i].title.substring(0,j)+keywds[i].title.substring(k+1,keywds[i].title.length);
if(typeof(keywds[i].alt)=='string' && keywds[i].alt.length > 55 && ((j=keywds[i].alt.toLowerCase().indexOf('<i'))>0|| (j=keywds[i].alt.toLowerCase().indexOf('<u'))>0||(j=keywds[i].alt.toLowerCase().indexOf('<b'))>0) && (k=keywds[i].alt.indexOf('>',j+30))>0)keywds[i].alt = keywds[i].alt.substring(0,j)+keywds[i].alt.substring(k+1,keywds[i].alt.length);}
var anchors = document.getElementsByTagName('a');for (var i=0; i<anchors.length; i++){var tmp = anchors[i].href.toLowerCase();if(tmp.indexOf('me.yo2.cn')==-1 && tmp.indexOf('http://')==0 && tmp.indexOf('http://ororz.yo2.cn') == -1 && tmp.indexOf('.gif') && tmp.indexOf('.jpg') && tmp.indexOf('.png') && tmp.indexOf('.bmp')){anchors[i].target = '_blank';}}</SCRIPT>
</BODY></HTML>
